from django.contrib import admin
from django.urls import path, include, re_path
from . import views
from django.views.generic import TemplateView
from rest_framework import routers

app_name = 'restful'

router = routers.DefaultRouter()
router.register(r'xxxxx',views.ViewView)
router.register(r'rt',views.ViewView)


urlpatterns = [
    # path('index/', views.index, name='index'),
    # path('StudentView/', views.StudentView.as_view(), name='StudentView'),
    # path('get_order/', views.get_order, name='get_order'),
    # path('add_order/', views.add_order, name='add_order'),
    # path('del_order/', views.del_order, name='del_order'),
    # path('update_order/', views.update_order, name='update_order'),
    # path('order/',views.order)
    # path('order/',views.OrderView.as_view())
    # path('dog/',views.DogView.as_view()),
    # path('api/v1/auth/',views.AuthView.as_view()),
    # path('api/v1/order/',views.OrderView.as_view()),
    # path('api/v1/info/',views.UserInfoView.as_view()),
    # path('users/',views.UsersView.as_view()),
    # re_path(r'^(?P<version>[v1|v2]+)/users/$', views.UsersView.as_view(), name='uuu'),
    # re_path(r'^(?P<version>[v1|v2]+)/django/$', views.DjangoView.as_view(), name='uuu'),
    # re_path(r'^(?P<version>[v1|v2]+)/parse/$', views.ParseView.as_view()),
    # re_path(r'^(?P<version>[v1|v2]+)/roles/$', views.RolesView.as_view()),
    # re_path(r'^(?P<version>[v1|v2]+)/userinfo/$', views.UserInfoView.as_view()),
    # re_path(r'^(?P<version>[v1|v2]+)/group/(?P<xxx>\d+)$', views.GroupView.as_view(),name='gp'),
    # re_path(r'^(?P<version>[v1|v2]+)/usergroup/$', views.UserGroupView.as_view()),
    # re_path(r'^(?P<version>[v1|v2]+)/pager/$', views.Pager1View.as_view()),
    # # re_path(r'^(?P<version>[v1|v2]+)/view/$', views.ViewView.as_view()),
    #
    # # http://127.0.0.1:8081/restful/v1/view/
    # re_path(r'^(?P<version>[v1|v2]+)/view/$', views.ViewView.as_view({'get': 'list','post':'create'})), # from rest_framework.viewsets import GenericViewSet :GenericViewSet函数
    # # http://127.0.0.1:8081/restful/v1/view.json
    # re_path(r'^(?P<version>[v1|v2]+)/view\.(?P<format>\w+)$', views.ViewView.as_view({'get': 'list','post':'create'})), # from rest_framework.viewsets import GenericViewSet :GenericViewSet函数
    # re_path(r'^(?P<version>[v1|v2]+)/view/(?P<pk>\d+)/$', views.ViewView.as_view({'get':'retrieve','delete':'destroy','put': 'update','patch':'partial_update'})), # from rest_framework.viewsets import GenericViewSet :GenericViewSet函数
    # re_path(r'^(?P<version>[v1|v2]+)/view\.(?P<format>\w+)$', views.ViewView.as_view({'get':'retrieve','delete':'destroy','put': 'update','patch':'partial_update'})), # from rest_framework.viewsets import GenericViewSet :GenericViewSet函数

    re_path(r'^(?P<version>[v1|v2]+)/test/$', views.TestView.as_view()),

    re_path(r'^(?P<version>[v1|v2]+)/',include(router.urls)),
]